<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Origami::Obfuscator</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Origami::Obfuscator</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/origami/obfuscation_rb.html">
                origami/obfuscation.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000369">junk_array</a>&nbsp;&nbsp;
      <a href="#M000370">junk_boolean</a>&nbsp;&nbsp;
      <a href="#M000367">junk_comment</a>&nbsp;&nbsp;
      <a href="#M000371">junk_dictionary</a>&nbsp;&nbsp;
      <a href="#M000372">junk_integer</a>&nbsp;&nbsp;
      <a href="#M000373">junk_name</a>&nbsp;&nbsp;
      <a href="#M000374">junk_null</a>&nbsp;&nbsp;
      <a href="#M000368">junk_object</a>&nbsp;&nbsp;
      <a href="#M000377">junk_real</a>&nbsp;&nbsp;
      <a href="#M000378">junk_reference</a>&nbsp;&nbsp;
      <a href="#M000366">junk_spaces</a>&nbsp;&nbsp;
      <a href="#M000375">junk_stream</a>&nbsp;&nbsp;
      <a href="#M000376">junk_string</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">WHITECHARS</td>
          <td>=</td>
          <td class="context-item-value">[ &quot; &quot;, &quot;\t&quot;, &quot;\r&quot;, &quot;\n&quot;, &quot;\0&quot; ]</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">OBJECTS</td>
          <td>=</td>
          <td class="context-item-value">[ Array, Boolean, Dictionary, Integer, Name, Null, Stream, String, Real, Reference ]</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">MAX_INT</td>
          <td>=</td>
          <td class="context-item-value">0xFFFFFFFF</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">PRINTABLE</td>
          <td>=</td>
          <td class="context-item-value">(&quot;!&quot;..&quot;9&quot;).to_a + (':'..'Z').to_a + ('['..'z').to_a + ('{'..'~').to_a</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">FILTERS</td>
          <td>=</td>
          <td class="context-item-value">[ :FlateDecode, :RunLengthDecode, :LZWDecode, :ASCIIHexDecode, :ASCII85Decode ]</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000369" class="method-detail">
        <a name="M000369"></a>

        <div class="method-heading">
          <a href="#M000369" class="method-signature">
          <span class="method-name">junk_array</span><span class="method-args">(max_size = 5)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000369-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000369-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 40</span>
40:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_array</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">5</span>)
41:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
42: 
43:       <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) {
44:         <span class="ruby-identifier">obj</span> = <span class="ruby-constant">Obfuscator</span>.<span class="ruby-identifier">junk_object</span> <span class="ruby-keyword kw">until</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Stream</span>)) ; <span class="ruby-identifier">obj</span>
45:       }.<span class="ruby-identifier">to_o</span> 
46:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000370" class="method-detail">
        <a name="M000370"></a>

        <div class="method-heading">
          <a href="#M000370" class="method-signature">
          <span class="method-name">junk_boolean</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000370-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000370-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 48</span>
48:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_boolean</span>
49:       <span class="ruby-constant">Boolean</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">zero?</span>)
50:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000367" class="method-detail">
        <a name="M000367"></a>

        <div class="method-heading">
          <a href="#M000367" class="method-signature">
          <span class="method-name">junk_comment</span><span class="method-args">(max_size = 15)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000367-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000367-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 17</span>
17:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_comment</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">15</span>)
18:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
19: 
20:       <span class="ruby-identifier">junk_comment</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) { 
21:         <span class="ruby-identifier">byte</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-value">256</span>).<span class="ruby-identifier">chr</span> <span class="ruby-keyword kw">until</span> (<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">byte</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">byte</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">byte</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;\r&quot;</span>); <span class="ruby-identifier">byte</span> 
22:       }.<span class="ruby-identifier">join</span>
23:       
24:       <span class="ruby-node">&quot;%#{junk_comment}#{EOL}&quot;</span>
25:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000371" class="method-detail">
        <a name="M000371"></a>

        <div class="method-heading">
          <a href="#M000371" class="method-signature">
          <span class="method-name">junk_dictionary</span><span class="method-args">(max_size = 5)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000371-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000371-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 52</span>
52:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_dictionary</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">5</span>)
53:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
54: 
55:       <span class="ruby-identifier">hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
56:       <span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> 
57:         <span class="ruby-identifier">obj</span> = <span class="ruby-constant">Obfuscator</span>.<span class="ruby-identifier">junk_object</span>
58:         <span class="ruby-identifier">hash</span>[<span class="ruby-constant">Obfuscator</span>.<span class="ruby-identifier">junk_name</span>] = <span class="ruby-identifier">obj</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Stream</span>)
59:       <span class="ruby-keyword kw">end</span>
60:       
61:       <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">to_o</span>
62:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000372" class="method-detail">
        <a name="M000372"></a>

        <div class="method-heading">
          <a href="#M000372" class="method-signature">
          <span class="method-name">junk_integer</span><span class="method-args">(max = MAX_INT)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000372-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000372-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 64</span>
64:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_integer</span>(<span class="ruby-identifier">max</span> = <span class="ruby-constant">MAX_INT</span>)
65:       <span class="ruby-constant">Integer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>))
66:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000373" class="method-detail">
        <a name="M000373"></a>

        <div class="method-heading">
          <a href="#M000373" class="method-signature">
          <span class="method-name">junk_name</span><span class="method-args">(max_size = 8)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000373-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000373-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 68</span>
68:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_name</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">8</span>)
69:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
70: 
71:       <span class="ruby-constant">Name</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) { <span class="ruby-constant">PRINTABLE</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">PRINTABLE</span>.<span class="ruby-identifier">size</span>)] }.<span class="ruby-identifier">join</span>)
72:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000374" class="method-detail">
        <a name="M000374"></a>

        <div class="method-heading">
          <a href="#M000374" class="method-signature">
          <span class="method-name">junk_null</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000374-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000374-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 74</span>
74:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_null</span>
75:       <span class="ruby-constant">Null</span>.<span class="ruby-identifier">new</span>
76:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000368" class="method-detail">
        <a name="M000368"></a>

        <div class="method-heading">
          <a href="#M000368" class="method-signature">
          <span class="method-name">junk_object</span><span class="method-args">(type = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000368-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000368-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 27</span>
27:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_object</span>(<span class="ruby-identifier">type</span> = <span class="ruby-keyword kw">nil</span>)
28: 
29:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">nil?</span>
30:         <span class="ruby-identifier">type</span> = <span class="ruby-constant">OBJECTS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">OBJECTS</span>.<span class="ruby-identifier">size</span>)]
31:       <span class="ruby-keyword kw">end</span>
32: 
33:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">Origami</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>)
34:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-value str">&quot;Not a valid object type&quot;</span>
35:       <span class="ruby-keyword kw">end</span>
36: 
37:       <span class="ruby-constant">Obfuscator</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;junk_#{type.to_s.split('::').last.downcase}&quot;</span>)
38:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000377" class="method-detail">
        <a name="M000377"></a>

        <div class="method-heading">
          <a href="#M000377" class="method-signature">
          <span class="method-name">junk_real</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000377-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000377-source">
<pre>
     <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 102</span>
102:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_real</span>
103:       <span class="ruby-constant">Real</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rand</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">rand</span>(<span class="ruby-constant">MAX_INT</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>))
104:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000378" class="method-detail">
        <a name="M000378"></a>

        <div class="method-heading">
          <a href="#M000378" class="method-signature">
          <span class="method-name">junk_reference</span><span class="method-args">(max_no = 300, max_gen = 1)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000378-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000378-source">
<pre>
     <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 106</span>
106:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_reference</span>(<span class="ruby-identifier">max_no</span> = <span class="ruby-value">300</span>, <span class="ruby-identifier">max_gen</span> = <span class="ruby-value">1</span>)
107:       <span class="ruby-identifier">no</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_no</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
108:       <span class="ruby-identifier">gen</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_gen</span>)
109: 
110:       <span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">no</span>, <span class="ruby-identifier">gen</span>)
111:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000366" class="method-detail">
        <a name="M000366"></a>

        <div class="method-heading">
          <a href="#M000366" class="method-signature">
          <span class="method-name">junk_spaces</span><span class="method-args">(max_size = 3)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000366-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000366-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 11</span>
11:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_spaces</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">3</span>)
12:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
13: 
14:       <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) { <span class="ruby-constant">WHITECHARS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">WHITECHARS</span>.<span class="ruby-identifier">size</span>)] }.<span class="ruby-identifier">join</span>
15:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000375" class="method-detail">
        <a name="M000375"></a>

        <div class="method-heading">
          <a href="#M000375" class="method-signature">
          <span class="method-name">junk_stream</span><span class="method-args">(max_data_size = 200)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000375-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000375-source">
<pre>
    <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 78</span>
78:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_stream</span>(<span class="ruby-identifier">max_data_size</span> = <span class="ruby-value">200</span>)
79:       
80:       <span class="ruby-identifier">chainlen</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
81:       <span class="ruby-identifier">chain</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">chainlen</span>) { <span class="ruby-constant">FILTERS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">FILTERS</span>.<span class="ruby-identifier">size</span>)] }
82: 
83:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_data_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
84:       <span class="ruby-identifier">junk_data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) { <span class="ruby-identifier">rand</span>(<span class="ruby-value">256</span>).<span class="ruby-identifier">chr</span> }.<span class="ruby-identifier">join</span>
85: 
86:       <span class="ruby-identifier">stm</span> = <span class="ruby-constant">Stream</span>.<span class="ruby-identifier">new</span>
87:       <span class="ruby-identifier">stm</span>.<span class="ruby-identifier">dictionary</span> = <span class="ruby-constant">Obfuscator</span>.<span class="ruby-identifier">junk_dictionary</span>(<span class="ruby-value">5</span>)
88:       <span class="ruby-identifier">stm</span>.<span class="ruby-identifier">setFilter</span>(<span class="ruby-identifier">chain</span>)
89:       <span class="ruby-identifier">stm</span>.<span class="ruby-identifier">data</span> = <span class="ruby-identifier">junk_data</span>
90: 
91:       <span class="ruby-identifier">stm</span>
92:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000376" class="method-detail">
        <a name="M000376"></a>

        <div class="method-heading">
          <a href="#M000376" class="method-signature">
          <span class="method-name">junk_string</span><span class="method-args">(max_size = 10)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000376-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000376-source">
<pre>
     <span class="ruby-comment cmt"># File origami/obfuscation.rb, line 94</span>
 94:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">junk_string</span>(<span class="ruby-identifier">max_size</span> = <span class="ruby-value">10</span>)
 95:       <span class="ruby-identifier">length</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">max_size</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
 96: 
 97:       <span class="ruby-identifier">strtype</span> = (<span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">zero?</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">ByteString</span> <span class="ruby-operator">:</span> <span class="ruby-constant">HexaString</span>
 98: 
 99:       <span class="ruby-identifier">strtype</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">length</span>) { <span class="ruby-constant">PRINTABLE</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">PRINTABLE</span>.<span class="ruby-identifier">size</span>)] }.<span class="ruby-identifier">join</span>)
100:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>